//package com.ruoyi.gateway.filter;
//
//import lombok.RequiredArgsConstructor;
//import org.springframework.http.HttpMethod;
//import org.springframework.stereotype.Component;
//import org.springframework.web.cors.reactive.CorsWebFilter;
//import org.springframework.web.server.ServerWebExchange;
//import org.springframework.web.server.WebFilter;
//import org.springframework.web.server.WebFilterChain;
//import reactor.core.publisher.Mono;
//
//
//@Component
//@RequiredArgsConstructor
//public class OptionsWebFilter implements WebFilter {
//
//    private final CorsWebFilter corsWebFilter;
//
//    @Override
//    public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) {
//        if (exchange.getRequest().getMethod() == HttpMethod.OPTIONS) {
//            return corsWebFilter.filter(exchange, chain);
//        }
//        return chain.filter(exchange);
//    }
//}
